import RouteButtonsBuilder from "@/framework/infra/router/RouterButtonsBuilder";
import TableButtonType from "@/framework/constant/TableButtonType";
import Layout from "@/layout";

export default [
  {
    path: '/mj',
    component: Layout,
    meta: {title: '英文版管理', icon: 'el-icon-s-help'},
    children: [
      {
        path: 'banner-en',
        component: () => import('@/feature/cms/app/banner/index'),
        meta: {title: 'banner管理', icon: 'table', lang: 'en'},
        buttons: RouteButtonsBuilder.builder('cms:banner').curdoo()
          .build()
      },
      {
        path: 'guide-en',
        component: () => import('@/feature/mj/app/guide-en/index'),
        meta: {title: '向导管理', icon: 'table'},
        buttons: RouteButtonsBuilder.builder('mj:guide-en')

          .addButtons([
            {
              handler: 'list',
              name: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'export',
              name: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'create',
              name: 'create',
              type: TableButtonType.TOOLBAR,
              label: '新建向导',
              icon: 'el-icon-plus'
            },
            {
              handler: 'update',
              name: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              name: 'remove',
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            }

          ])
          .build()
      },
      {
        path: 'spot-en',
        component: () => import('@/feature/mj/app/spot-en/index'),
        meta: {title: '景点管理', icon: 'table'},
        buttons: RouteButtonsBuilder.builder('mj:spot-en')

          .addButtons([
            {
              handler: 'list',
              name: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'export',
              name: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'create',
              name: 'create',
              type: TableButtonType.TOOLBAR,
              label: '新建景点',
              icon: 'el-icon-plus'
            },
            {
              handler: 'update',
              name: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              name: 'remove',
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            }

          ])
          .build()
      }
    ]
  }
]
